package 选课系统;

import java.io.FileWriter;
import java.io.IOException;


public class Wenjian {
	//输出学生的选课结果的txt文件
	//使用writeObject方法保存到地盘的位置
	//使用readObject读取文件，进行覆盖字节位置达到改变课表的结果，并将改变的结果转化为数据覆盖在学生的选课中
	
	

	public static void main(String[] args) throws IOException{
		Teacher teacher1 = new Teacher("T1","赵老师","男");
		Student stu1 = new Student("S1","张三","男");
		Course cour1 = new Course("C1","高数","教101","8:00-9:40",teacher1);
		stu1.addCourse(cour1);
		
		FileWriter f = new FileWriter("d://Java文件储存/wenben.txt");
		f.write(stu1.name+"的课表为：\n");
		f.append(cour1.course_id+"  "+cour1.course_name+"  "+cour1.course_where+"  "+cour1.course_time+"  "+cour1.teacher);
		//f.flush();
        f.close();
        System.out.println("课表储存运行完毕");
	}
	
}

